package com.richinfo.buddy.common.provider;

import java.util.List;

import com.github.pagehelper.PageInfo;
import com.richinfo.buddy.common.model.QueryExample;
import com.richinfo.buddy.common.service.BaseServices;

public abstract class BaseProviderImpl<T, ID> implements BaseProvider<T, ID> {

    public abstract BaseServices<T, ID> getBaseServices();

    @Override
    public Integer add(T t) {
        return getBaseServices().add(t);
    }

    @Override
    public Integer batchAdd(List<T> list) {
        return getBaseServices().batchAdd(list);
    }

    @Override
    public Integer deleteById(ID id) {
        return getBaseServices().deleteById(id);
    }

    @Override
    public Integer delete(T t) {
        return getBaseServices().delete(t);
    }

    @Override
    public Integer updateByPrimaryKey(T t) {
        return getBaseServices().updateByPrimaryKey(t);
    }

    @Override
    public Integer batchUpdateByPrimaryKey(List<T> list) {
        return getBaseServices().batchUpdateByPrimaryKey(list);
    }

    @Override
    public T findOne(T t) {
        return getBaseServices().findOne(t);
    }

    @Override
    public List<T> findAll() {
        return getBaseServices().findAll();
    }

    @Override
    public T findById(ID id) {
        return getBaseServices().findById(id);
    }

    @Override
    public List<T> find(T t) {
        return getBaseServices().find(t);
    }

    @Override
    public Integer updateByExampleSelective(QueryExample<T> queryExample) {
        return getBaseServices().updateByExampleSelective(queryExample);
    }

    @Override
    public PageInfo<T> findPage(T t, Integer pageNum, Integer pageSize) {
        return getBaseServices().findPage(t, pageNum, pageSize);
    }

    @Override
    public Integer updateByExampleSelective(T record, T query) {
        return getBaseServices().updateByExampleSelective(record, query);
    }

    @Override
    public Integer findCount(T record) {
        return getBaseServices().findCount(record);
    }
}
